package com.unisv.dj.util;

/**
 * <p>
 * init parameter
 * </p>
 * 
 * @author fanzhen
 * @time 2:45:51 PM Oct 5, 2011
 * @email fanzhen.meng@gmail.com
 */
public class InitParameter {
	private static final String p1 = "5,10,15,20,25,30,35,40,45,50";
	private static final String p2 = "10,20,30,40,50,50,40,30,20,10";
	private static final String p3 = "1,50,1,50,1,50,1,50,1,50";
	private static final String p4 = "10,30,50,20,40,10,30,50,20,40";
	private static final String p5 = "50,30,10,30,50,30,50,10,30,50";

	private static final long MANUALTMAX = 10 * 60 * 1000L;
	private static final int MANUALINITSPEED = 10;
	private static final long CYCLETMAX = 10 * 60 * 1000L;
	private static final long CYCLERUNTIME = 20 * 1000L;
	private static final long CYCLESUSPEND = 5 * 1000L;
	private static final int CYCLEPAGE = 0;
	private static final long COACHTMAX = 10 * 60 * 1000L;
	private static final long COACHRUNTIME = 20 * 1000L;
	private static final long COACHSUSPEND = 5 * 1000L;
	private static final int COACHPAGE = 0;
	private static final int RATE = 75;

	public static int getP1(String p, int position) {
		if (p.equalsIgnoreCase("p1")) {
			p = p1;
		} else if (p.equalsIgnoreCase("p2")) {
			p = p2;
		} else if (p.equalsIgnoreCase("p3")) {
			p = p3;
		}else if (p.equalsIgnoreCase("p4")) {
			p = p4;
		}else if (p.equalsIgnoreCase("p5")) {
			p = p5;
		}
		String[] ps = p.split(",");
		if (ps.length > position) {
			return Integer.parseInt(ps[position]);
		} else {
			return 0;
		}
	}
}